﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LoungeRepo.Contracts.Core;
using LoungeRepo.Contracts.Normalizer;

namespace LoungeRepo.Normalizer.DataStructures
{
    [Serializable]
    internal class NormalizedEntity : NormalizedObject, INormalizedEntity
    {
        [CoverageExclude] protected NormalizedEntity() {}
        public NormalizedEntity(string id, string partition, Type objectType)
            :base(objectType)
        {
            this.Id = id;
            this.Partition = partition;
        }

        public string Id { get; private set; }
        public string Partition { get; private set; }

        public override string RefId
        {
            get { return this.BuildRefId(); }
        }
    }


    [Serializable]
    internal class NormalizedEntityReference : ILoungeRepoEntityIdentity, INormalizedObjectReference
    {
        public NormalizedEntityReference(ILoungeRepoEntityIdentity entity)
        {
            this.Id = entity.Id;
            this.Partition = entity.Partition;
        }

        #region Implementation of ILoungeRepoEntityIdentity
        public string Id {get; private set; }
        public string Partition { get; private set; }
        #endregion

        #region Implementation of INormalizedObjectReference
        public string RefId
        {
            get { return this.BuildRefId(); }
        }
        #endregion
    }
}
